
<div style="margin-top: 5%;text-align: center;display: flex;flex-direction: row" >
    {{ csrf_input }}
    <input type="date" name="start">
    <input type="date" name="end">
    <input type="button" id="statistics"  value="statistics">
    <script>
        $("body").on("click","#statistics",function () {
            $.post(
                "{{ url('root@statistics') }}",
                {
                    "csrfmiddlewaretoken":$('input[name="csrfmiddlewaretoken"]').val(),
                    "start":$('input[name="start"]').val(),
                    "end":$('input[name="end"]').val()
                },
                function (data,status) {
                    $(".container-xl").html(data)
                }
            )
        })
    </script>
</div>

<table class="table table-striped">
    <thead>
      <tr>
        <th>enroll in a course</th>
        <th>register for exam</th>
        <th>passing rate(sub1)</th>
        <th>passing rate(sub2)</th>
        <th>passing rate(sub3)</th>
          <th>passing rate(sub4)</th>
      </tr>
    </thead>
    <tbody>

        <tr>
        <td>{{ courses }}</td>
        <td>{{ exam }}</td>
        <td>{{ sub1 }}</td>
        <td>{{ sub2 }}</td>
        <td>{{ sub3 }}</td>
        <td>{{ sub4 }}</td>
      </tr>

    </tbody>
</table>

<h2>reserve information</h2>
{% if book_msg %}
    <table class="table table-dark table-striped">
        <thead>
          <tr>
              <th>student</th>
            <th>datetime</th>
            <th>coach</th>
            <th>coach tel</th>

          </tr>
        </thead>
        <tbody>
        {% for i in book_msg %}
          <tr id="{{ i.id }}">
            <td>{{ i.student.name }}</td>
            <td>{{ i.train_time }}</td>
            <td>{{ i.teacher.name }}</td>
            <td>{{ i.teacher.tel }}</td>
        </tr>
        {% endfor %}
        </tbody>
    </table>
                    {% else %}
    <span>There was no reservation information</span>
{% endif %}

<h2>Test Booking Information</h2>
{% if examination %}
     <table class="table table-dark table-striped">
        <thead>
          <tr>
            <th>student</th>
            <th>datetime</th>
            <th>type</th>
            <th>score</th>

          </tr>
        </thead>
        <tbody>
        {% for i in examination %}
          <tr>
            <td>{{ i.student.name }}</td>
            <td>{{ i.exaln.examination_time }}</td>
            <td>{{ i.exaln.get_examination_type_display() }}</td>
            <td>{{ i.score }}</td>
         </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
    <span>I haven't booked an exam yet</span>
{% endif %}

